package com.enba.rbacadmin.enums;

import com.enba.boot.core.enums.ICode;

/** 验证码场景枚举 */
public enum CaptchaSceneEnum implements ICode {
  LOGIN_CAPTCHA(100000, "登录验证码", "captcha:login:"),

  REGISTER_CAPTCHA(200000, "注册验证码", "captcha:register:");

  private final Integer code;

  private final String msg;

  private final String redisKeyPrefix;

  private CaptchaSceneEnum(Integer code, String msg, String redisKeyPrefix) {
    this.code = code;
    this.msg = msg;
    this.redisKeyPrefix = redisKeyPrefix;
  }

  @Override
  public Integer getCode() {
    return code;
  }

  @Override
  public String getMsg() {
    return msg;
  }

  public String getRedisKeyPrefix() {
    return redisKeyPrefix;
  }

  // redis key
  public String getRedisFullKey(String keySuffix) {
    return this.getRedisKeyPrefix() + keySuffix;
  }
}
